package com.education.api.controller.admin.system;


import com.education.business.mapper.system.ClearTableMapper;
import com.education.common.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class ClearTableController extends BaseController{
    @Autowired
    private ClearTableMapper clearTableMapper;

    @GetMapping("/clearTable")
    public int clearTable(){
        List<String> list = clearTableMapper.selectTables();
        for(String str : list) {
            System.out.println(str);
            clearTableMapper.truncateTable(str);
        }
        return 1;
    }


}
